<div class="layui-card">
	<div class="layui-card-body" id="roleEditPageDiv">
		<form class="layui-form layui-form-pane" id="userEditForm" lay-filter="userEditFormFilter">
			<input type="hidden" name="id" />
			<div class="layui-form-item">
				<div class="layui-block">
					<label class="layui-form-label required">标题</label>
					<div class="layui-input-block">
						<input name="title" lay-verify="required" autocomplete="off" class="layui-input" placeholder="请输入反馈标题" />
					</div>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-block">
						<textarea class="layui-textarea" name="content" id="feedback-content" style="display: none"></textarea>
				</div>
			</div>
			<div class="layui-form-item dialog-form-footer">
				<button class="layui-btn" lay-filter="userFormSubmit" lay-submit>提交</button>
			</div>
		</form>
	</div>
</div>
<script type="text/javascript">
layui.use(["layedit", 'form', 'admin'], function(){
	var layedit = layui.layedit
	layedit.set({
	  uploadImage: {
	    url: '/admin/feedback/uploadImg' //接口url
	  }
	});
	var layeditIndex = layedit.build('feedback-content');
	var pageId = "feedBackEditPage";
	var admin = layui.admin;
	layui.form.on("submit(userFormSubmit)", function(data){
		data.field["content"] = layedit.getContent(layeditIndex);
		console.log(data.field)
		admin.ajax.post("/admin/feedback/save", data.field,{
			method : "POST",
			ok : function(resp){
				admin.setPageCallBackData(pageId, true);
				pageId && admin.layerClose(pageId);
			}
		});
		return false;
	})
})
</script>